package com.fooddelivery.Common.responseVO;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;

/**
 * 保存订单请求对象
 * 包含订单基本信息和订单菜品列表
 */
@Data
@ApiModel(value = "SaveOrderVO", description = "保存订单请求对象")
public class SaveOrderVO {

    @ApiModelProperty(value = "收货地址", required = true, example = "北京市海淀区中关村大街1号")
    private String address;

    @ApiModelProperty(value = "用户ID", required = true, example = "123")
    private Long userId;

    @ApiModelProperty(value = "订单备注", example = "")
    private String notes;

    @ApiModelProperty(value = "订单菜品列表", required = true)
    private List<OrderItem> items;

    @ApiModelProperty(value = "订单总金额", required = true, example = "150.00")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "订单总数量", required = true, example = "3")
    private Integer totalQuantity;

    /**
     * 订单菜品项
     */
    @Data
    @ApiModel(value = "OrderItem", description = "订单菜品项")
    public static class OrderItem {

        @ApiModelProperty(value = "菜品ID", required = true, example = "4")
        private Long dishId;

        @ApiModelProperty(value = "购买数量", required = true, example = "1")
        private Integer quantity;

        @ApiModelProperty(value = "菜品单价", required = true, example = "35.00")
        private BigDecimal price;

        @ApiModelProperty(value = "菜品名称", required = true, example = "葱烧海参")
        private String name;

        @ApiModelProperty(value = "菜品小计金额", required = true, example = "35.00")
        private BigDecimal totalPrice;
    }
}
